const events = require("events")
const event = new events()

//2.监听某一个事件
//on
//addListener

const click1 = (args) => {
  console.log('click', args);
}
event.on('click', click1)
event.on('click', (args) => {
  console.log('click2', args);
})
event.on("tap", (args) => {
  console.log("tap", args);
})
//3.获取注册的事件
console.log(event.eventNames());
console.log(event.listenerCount("click"));
console.log(event.listeners("click"));